#ifndef COLORSELECTOR_H
#define COLORSELECTOR_H

#include <QFrame>
#include <QLabel>
#include <QColor>
#include <QSlider>
#include <QVBoxLayout>
#include <QSpinBox>
#include <ui/ColorWidget.h>

#include <string>

using namespace std;

class ColorSelector : public QFrame
{
	Q_OBJECT
	Q_PROPERTY(QColor color READ currentColor WRITE setColor)
	private:
		string m_name;
		QSlider * m_sliders[3];
		QSpinBox * m_spinboxes[3];
		ColorWidget * m_colorWidget;
		QLabel * m_label;
		QColor m_currentColor;
		void initialize(string name, QColor color);
	public:
		ColorSelector(string name, QColor color, QWidget *parent=0 );
		ColorSelector(QWidget * parent=0);
		QColor currentColor() const{return m_currentColor;}
		void setColor(QColor color);
	public slots:
		void colorValueChanged(QColor color);
	signals:
		void colorChanged( string name, QColor color );

};

#endif // COLORSELECTOR_H
